#define IOTA_EXPORTS
#include "iota.h"
#include "iotaimp.h"
#include "cjson/cJSON.h"
#include "zlog.h"

void IOTA_SetCallBackSurAg(PFN_CALLBACK_HANDLER_SAG pfnCallbackHandler)
{
	IOTA_setCallbackSag(pfnCallbackHandler);

}
int IOTA_SendMqtt(char* pcTopicName, char *data, int size)
{
	return  IOTA_sendMqtt(pcTopicName, data, size);
}


IOTA_API void IOTA_SetExternalCallback(int iItem, PFN_EXTERNAL_CALLBACK_HANDLER pfnCallbackHandler)
{
	return IOTA_setExternalCallback(iItem, pfnCallbackHandler);
}

IOTA_API int IOTA_Init(char* pcWorkPath, char* pcLogPath)
{
	return IOTA_init(pcWorkPath, pcLogPath);
}

IOTA_API void IOTA_Destroy()
{
	return IOTA_destroy();
}

IOTA_API void IOTA_SetCallback(int iItem, PFN_CALLBACK_HANDLER pfnCallbackHandler)
{
	return IOTA_setCallback(iItem, pfnCallbackHandler);
}

IOTA_API void IOTA_SetCallbackWithTopic(PFN_CALLBACK_HANDLER_TOPIC pfnCallbackTopicHandler)
{
	return IOTA_setCallbackWithTopic(pfnCallbackTopicHandler);
}

IOTA_API void IOTA_SetPrintLogCallback(PFN_LOG_CALLBACK_HANDLER pfnLogCallbackHandler)
{
	return IOTA_setPrintLogCallback(pfnLogCallbackHandler);
}

IOTA_API int IOTA_ConfigSetStr(int iItem, char* pValue)
{
	return IOTA_configSetStr(iItem, pValue);
}

IOTA_API int IOTA_ConfigSetUint(int iItem, HW_UINT uiValue)
{
	return IOTA_configSetUint(iItem, uiValue);
}


IOTA_API int IOTA_Login()
{
	return IOTA_login();
}

IOTA_API int IOTA_Logout()
{
	return IOTA_logout();
}

IOTA_API int IOTA_HubDeviceAdd(HW_UINT uiMid, ST_IOTA_DEVICE_INFO* pstInfo)
{
	return IOTA_hubDeviceAdd(uiMid, pstInfo);
}

IOTA_API int IOTA_HubDeviceRemove(HW_UINT uiMid, char* pcDeviceId)
{
	return IOTA_hubDeviceRemove(uiMid, pcDeviceId);
}

IOTA_API int IOTA_DeviceStatusUpdate(HW_UINT uiMid, char* pcDeviceId, char* pcStatus)
{
	return IOTA_deviceStatusUpdate(uiMid, pcDeviceId, pcStatus);
}

IOTA_API int IOTA_HubDeviceQuery(HW_UINT uiMid, char* pcMarker, HW_UINT uiLimit, ST_IOTA_DEVICE_INFO* pstDeviceInfo)
{
	return IOTA_hubDeviceQuery(uiMid, pcMarker, uiLimit, pstDeviceInfo);
}

IOTA_API int IOTA_ServiceDataReport(char* pcDeviceId, char* pcServiceId, char* pcServiceProperties)
{
	return IOTA_serviceDataReport(pcDeviceId, pcServiceId, pcServiceProperties);
}

IOTA_API int IOTA_ServiceCommandResponse(HW_UINT uiMid, HW_UINT uiResultCode, char* pcCommandResponse)
{
	return IOTA_serviceCommandResponse(uiMid, uiResultCode, pcCommandResponse);
}

IOTA_API int IOTA_ServiceCustomTopicReport(ST_IOTA_BatchReportProperties* pstDevInfo, char* pcTopicVersion, char* pcCustomTopic)
{
	return IOTA_serviceCustomTopicReport(pstDevInfo, pcTopicVersion, pcCustomTopic);
}

IOTA_API int IOTA_SubscribeCustomTopic(char* pcTopicVersion, char* pcCustomTopic)
{
	return IOTA_subscribeCustomTopic(pcTopicVersion, pcCustomTopic);
}

IOTA_API int IOTA_SetCertPath(char* pcCertPath)
{
	return IOTA_setCertPath(pcCertPath);
}
